import React from 'react'
import { Col} from 'antd'
import {QuestionButton} from "./QuestionButton"


export class BaseGroup extends React.Component {
    constructor (props) {
        super(props)

        this.toggle = this.toggle.bind(this)
        this.getId = this.getId.bind(this)
        this.getLabel = this.getLabel.bind(this)
        this.getQuestion = this.getQuestion.bind(this)
        this.state = {
            collapse: false,
        }
    }

    toggle () {
        this.setState({
            collapse: !this.state.collapse,
        })
    }

    getId () {
        const{id, label} = this.props

        const combinedId = id + (label + '').replace( ' ', '')

        return combinedId
    }

    getLabel (){
        const{label} = this.props

        return label;
    }

    getQuestion (){
        const{qmd, id} = this.props

        return (
            <Col style={{paddingLeft:'0px'}}>
                <QuestionButton id={id + "question-btn"} toggle={this.toggle}/>
            </Col>
        )
    }


}
